#支持向量机回归
#SVR
#Regressor

import pandas as pd
from sklearn import svm


def SVR(data, target):
  svr = svm.SVR(C=1000)
  svr.fit(data, target)
  return svr


def main():
  # 读取Excel文件数据
  data = pd.read_excel('data.xlsx')
  # 提取特征和目标变量
  target = data['target']
  data = data.drop('target', axis=1)

  # 调用SVR函数
  model = SVR(data, target)

  # 打印模型参数
  print(model)

  # 预测新数据
  new_data = [[7, 8], [9, 10]]
  predictions = model.predict(new_data)
  print("Predictions:", predictions)


if __name__ == "__main__":
  main()